<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<%@ page import="javax.jdo.PersistenceManager"%>
<%@ page import="com.google.appengine.api.users.User"%>
<%@ page import="com.google.appengine.api.users.UserService"%>
<%@ page import="com.google.appengine.api.users.UserServiceFactory"%>
<%@ page import="com.engine.taskmask.persistence.PMF"%>
<%@ page import="com.engine.taskmask.persistence.iTask"%>
<%@ page import="java.util.List"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Test JSP</title>

<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="screen" href="/bootstrap/css/bootstrap-datetimepicker.min.css">

</head>

<body>


	<%-- 	<%
		UserService userService = UserServiceFactory.getUserService();
		User user = userService.getCurrentUser();
		if (user != null) {
	%>
	<p>
		Hello,
		<%=user.getNickname()%>! (You can <a
			href="<%=userService.createLogoutURL(request.getRequestURI())%>">sign
			out</a>.)
	</p>
	<%
		} else {
	%>
	<p>
		Hello! <a
			href="<%=userService.createLoginURL(request.getRequestURI())%>">Sign
			in</a>
	</p>
	<%
		}
	%>


	<br>
	<br> // 1- get Itasks elements.
	<br>
	<br>

	<%
		PersistenceManager pm = PMF.get().getPersistenceManager();
		String query = "select from " + iTask.class.getName();
		// need to get r from the id i get from singer page 
		List<iTask> tasks = (List<iTask>) pm.newQuery(query).execute();
		int i = 0;
		if (tasks.isEmpty()) {
	%>
	<p>no Tasks</p>
	<%
		} else {
	%>

	<%
		for (iTask r : tasks) {
				r.setTaskTitle("to-do");
				r.setTaskNotes("aasdasd asd  asd asd as das das da sda sd asd as da sd");
	%>
	<p align="center"
		style="font: Arial, Helvetica, sans-serif; color: #5C7B2F; font-size: 40px">
		<%=r.getTaskTitle() + " " + r.getDate_s()%></p>

	<p align="center"
		style="font: Arial, Helvetica, sans-serif; color: #5C7B2F; font-size: 22px">
		Location
		<%=r.getTaskLocation()%>
		Cat:
		<%=r.getTaskCategory()%>
		</p>

		<table align="center" cellspacing="100" id="header">
			<tr>
				<td width="250"><img src="images/notes.png"> <br> <strong
					style="font: 'Times New Roman', Times, serif"> <%=r.getTaskNotes()%>
				</strong></td>
				<td>&nbsp;</td>
			</tr>
		</table>
		
	<%
    }}
    pm.close();
%> --%>

	<p>
	<h1>TEST TAKVIM</h1>
	</p>

	<br>
	<br>

	<div class="control-group">
		<label class="control-label">Date</label>
		<div id="datetimepicker" class="input-append date">
			<input type="text"></input> <span class="add-on"> 
			<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
			</span>
		</div>
	</div>



	<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
  
    <script src="/bootstrap/js/bootstrap-datetimepicker.min.js">
    </script>

	<script type="text/javascript">
      $('#datetimepicker').datetimepicker({
        format: 'dd/MM/yyyy',
        pickTime: false
      });
    </script>
    
</body>
</html>